package net.sky.oa.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *通知员工表
 *InfNoticeUser. @author hond
 */
@Entity
@Table(name = "INF_NOTICE_USER")//通知员工表
public class InfNoticeUser implements java.io.Serializable {

	private static final long serialVersionUID = 5673991033245515351L;
	
	// Fields
	protected Long id; 
	private InfNotice notice;//通知id
	private SysEmployee employee;  //员工id
	private Integer isread;  //是否查阅：1是2否
	private Date readtime;   //查阅时间
	private Integer status;     //状态

	// Constructors

	/** default constructor */
	public InfNoticeUser() {
	}

	@Id
	@Column(name = "ID", unique = true, nullable = false)
	@SequenceGenerator(name="SQ_INFNOTICEUSER_ID",sequenceName="SQ_INFNOTICEUSER_ID",allocationSize=1)
    @GeneratedValue(strategy=GenerationType.SEQUENCE,generator="SQ_INFNOTICEUSER_ID")
	public Long getId() {
	    return id;
	}

	public void setId(Long id){
	    this.id = id;
	}
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "NOTICE_ID")
	public InfNotice getNotice() {
		return this.notice;
	}

	public void setNotice(InfNotice notice) {
		this.notice = notice;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "user_id")
	public SysEmployee getEmployee() {
		return this.employee;
	}

	public void setEmployee(SysEmployee employee) {
		this.employee = employee;
	}

	@Column(name = "ISREAD", precision = 1, scale = 0)
	public Integer getIsread() {
		return this.isread;
	}

	public void setIsread(Integer isread) {
		this.isread = isread;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "READTIME", length = 7)
	public Date getReadtime() {
		return this.readtime;
	}

	public void setReadtime(Date readtime) {
		this.readtime = readtime;
	}

	@Column(name = "STATUS", precision = 2, scale = 0)
	public Integer getStatus() {
		return this.status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

}